home *** CD-ROM | disk | FTP | other *** search
-
-
- /****************************************
- * *
- * *
- * custom string library *
- * 7/10/86 *
- * MMSTR.C *
- * *
- * LIGHTSPEED *
- * *
- * John Pence, Macman, Inc. *
- * *
- ****************************************/
-
- /*
- in this file:
-
- char *strnac(str1,str2,num)
- char *str1,str2;
- int num;
-
- char *strtac(str1,str2)
- char *str1,str2;
-
- */
- extern int strlen();
-
- char *strtac(s1,s2)
- register char *s1,*s2;
- {
- char *result = s1;
- register int n = strlen(s2);
-
-
- while(*s1++);
-
-
- while(--s1 >= result)
- *(s1+n)=*s1; /* move string1 over */
-
-
- s1++; /* point s1 back to start of string1 */
- while(*s2) /* move string2 into beginning of string1 */
- *(s1++) = *(s2++);
-
-
- return result;
- } /* strtac */
-
-
-
-
- char *strntac(s1,s2,num)
- register char *s1,*s2;
- register int num;
- {
- register int i;
- char *result = s1;
- char *string2 = s2;
- register int len2 = 0;
-
- if(num > (len2=strlen(s2) ) ) num = len2;
-
- while(*s1++); /* advance to end */
-
- while(--s1 >= result)
- *(s1+num)=*s1; /* move string1 over */
- s1++ ; /* point s1 back to start of string1 */
-
- for(i=0;i<num; i++) /* move string2 into beginning of string1 */
- s1[i] = s2[i];
-
- return result;
- } /* strntac */
-
-
-
-
-
-
-
-
-
-
-
-
-